package com.fh.shop.controller;/**
 * 描述:
 * Author:袁亚强
 * Date:2021/12/2214:52
 */

import com.fh.common.baseData.TableParams;
import com.fh.common.baseData.TongyiData;
import com.fh.shop.entity.po.Order;
import com.fh.shop.service.OrderService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * created by macro on 2021/12/22,
 */
@RestController
@RequestMapping("authorder")
public class OrderController {

    @Autowired
    private OrderService orderService;

    @PostMapping("createOrder")
    public TongyiData createOrder(Order order) {
        return TongyiData.succeess(orderService.createOrder(order));
    }

    @PostMapping("getUrl")
    public TongyiData getUrl(String oid) {
        return TongyiData.succeess(orderService.getUrl(oid));
    }

    @PostMapping("qeuryOid")
    public TongyiData qeuryOid(String oid) {
        return TongyiData.succeess(orderService.qeuryOid(oid));
    }


    @PostMapping("queryPage")
    public TongyiData queryPage(TableParams params) {
        return TongyiData.succeess(orderService.queryPage(params));
    }

    @PostMapping("del")
    public TongyiData del(String id) {
        orderService.del(id);
        return TongyiData.succeess("");
    }

    @PostMapping("queryByOid")
    public TongyiData queryByOid(String oid) {
        return TongyiData.succeess(orderService.queryByOid(oid));
    }
}
